A=[[3,3],[4,3],[1,1]]
L=[1,1,-1]

from sklearn.svm import LinearSVC as model
clf=model(C=1e10)
clf.fit(A,L)
print(clf.coef_, clf.intercept_)
# 默认所有参数， [[0.26463715 0.25677862]], [-0.83268363]
# C改为无穷，趋向于硬间隔， [[0.49996307 0.49996307]] [-1.99992615]
# [[1/2, 1/2], [-2]
print(clf.predict(A))


from heapq import heapify


A=[[0,0],[1,1],[0,1],[1,0]]
L=[1,1,-1,-1]
from sklearn.svm import SVC as model
clf=model(gamma='scale')
clf.fit(A,L)
print(clf.predict(A))

from sklearn.svm import SVC as model
clf=model(kernel='poly',gamma='scale',C=1e10)
clf.fit(A,L)
print('Poly:',clf.predict(A))

from sklearn.linear_model import RidgeClassifier as model
clf=model()
clf.fit(A,L)
print(clf.predict(A))

from sklearn.ensemble import GradientBoostingClassifier as model
clf=model()
clf.fit(A,L)
print(clf.predict(A))

from sklearn.ensemble import RandomForestClassifier as model
clf=model()
clf.fit(A,L)
print(clf.predict(A))

from sklearn.tree import DecisionTreeClassifier as model
clf=model()
clf.fit(A,L)
print(clf.predict(A))